# RUN: tf-mlir-translate -graphdef-to-mlir -tf-enable-shape-inference-on-import=false %s -tf-input-arrays=input -tf-input-data-types=DT_FLOAT -tf-output-arrays=output_node -o - | FileCheck %s

node {
  name: "input"
  op: "Placeholder"
  attr {
    key: "dtype"
    value {
      type: DT_FLOAT
    }
  }
  attr {
    key: "shape"
    value {
      shape {
        dim {
          size: 1
        }
      }
    }
  }
}
node {
  name: "variable_node"
  op: "Const"
  input: "^input"
  attr {
    key: "dtype"
    value {
      type: DT_FLOAT
    }
  }
  attr {
    key: "value"
    value {
      tensor {
        dtype: DT_FLOAT
        tensor_shape {
        }
        float_val: 1
      }
    }
  }
}
node {
  name: "output_node"
  op: "Identity"
  input: "variable_node"
  input: "^input"
  attr {
    key: "T"
    value {
      type: DT_FLOAT
    }
  }
}
library {
}
versions {
}

# CHECK-LABEL: func @main
# CHECK-SAME:  (%[[ARG_0:[a-z0-9]+]]: tensor<f32>) -> tensor<*xf32>
# CHECK-SAME:  control_outputs = ""
# CHECK-SAME:  inputs = "input"
# CHECK-SAME:  outputs = "output_node"
# CHECK:         %[[GRAPH:[0-9]+]] = tf_executor.graph
# CHECK:           %[[CONST:.*]], %[[CONST_control:.*]] = tf_executor.island wraps "tf.Const"()
# CHECK:           %[[OUTPUT:.*]], %[[OUTPUT_control:.*]] = tf_executor.island wraps "tf.Identity"(%[[CONST]])
# CHECK:           tf_executor.fetch %[[OUTPUT]]
# CHECK:         return %[[GRAPH]]
